Next, a sample description is prepared. This is identical to the sample description that would be prepared if the effect was added to a QuickTime movie. The code in Listing 8 creates a sample description.
Listing 8 Preparing a Sample Description
ImageDescriptionHandle QTEffects_MakeSampleDescription
(OSType theEffectType, short theWidth, short theHeight)
{
ImageDescriptionHandle mySampleDesc = nil;
OSErr myErr = noErr;
// create a new sample description
myErr = MakeImageDescriptionForEffect(theEffectType, &mySampleDesc);
if (myErr != noErr)
return(nil);
// fill in the fields of the sample description
(**mySampleDesc).width = theWidth;
(**mySampleDesc).height = theHeight;
return(mySampleDesc);
}
To use this code snippet to create a a sample description for an SMPT wipe effect, for example, you would set theEffectType to 'smpt' .
| Previous | Chapter Contents | Chapter Top | Next |